<?php 
if(!defined('ADMIN')){
	exit('Access Denied');
}
?>
<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="<?=$page?>" />
	<input type="hidden" name="numPerPage" value="<?=$pagesize?>" />
	<input type="hidden" name="orderField" value="<?=$orderField?>" />
	<input type="hidden" name="orderDirection" value="<?=$orderDirection?>" />
</form>
<div class="pageHeader">
	
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<?=u(MOD,'addedicoupon')?>" target="navTab" rel="addedipage88"><span>添加优惠券</span></a></li>
			
			<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="118">
		<thead>
			<tr>
				
				<th width="50" align="center">ID</th>
				
                <th width="150" align="center">标题</th>
                <th width="150" align="center">有效时间</th>
				<th width="150" align="center">每人可用数量</th>
				<th width="150" align="center">当前剩余总数量</th>
                <th width="150" align="center">状态</th>
				<th width="200" align="center">操作</th>
			</tr>
		</thead>
        <tbody>
        <?php foreach ($row as $r){?>
                <td class="center"><?=$r["id"]?></td>	
                <td class="center"><?=$r["title"]?></td>
                <td class="center"><?=date('Y-m-d', $r['starttime'])?>-<?=date('Y-m-d', $r['endtime'])?></td>
                <td><?=$r["pretotal"]?></td>
    			<td class="center"><?=$r["total"]?></td>
				<td class="center"><?if($r["status"]==0)echo '<span style="color:blue;">正常</span>';elseif($r["status"]==1) echo '<span style="color:red;">停止</span>';else echo '<span style="color:red;">已删除</span>';?></td>
				<td class="center">
					<a title="修改" target="navTab"  href="<?=u(MOD,'addedicoupon',array('id'=>$r['id']))?>" class="btnEdit">编辑</a>
				</td>
		</tr>
        <?php }?>   
		</tbody>
	</table>            
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})" id="PageSize">
				<option value="20" <? if($pagesize==20){ echo 'selected="true"';}?>>20</option>
				<option value="50" <? if($pagesize==50){ echo 'selected="true"';}?>>50</option>
				<option value="100" <? if($pagesize==100){ echo 'selected="true"';}?>>100</option>
				<option value="200" <? if($pagesize==200){ echo 'selected="true"';}?>>200</option>
			</select>
			<span>条，共<?php echo $total;?>条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="<?php echo $total;?>" numPerPage="<?=$pagesize?>" pageNumShown="10" currentPage="<?=$page?>"></div>

	</div>
</div>    
